home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc2 / led.lha / LED / LED.c < prev    next >
C/C++ Source or Header  |  1996-03-31  |  654b  |  28 lines

  1. /* LED                                                               
  2.  * Toggle the state of the audio filter (CIAF_LED)
  3.  *
  4.  * Returns 0 if filter OFF (LED fully ON) 
  5.  *   "     1 if filter ON  (LED dimmed, or OFF, depending on Amiga model ;-)
  6.  *  
  7.  * Shell ONLY!!
  8.  */
  9.  
  10. #define __USE_SYSBASE 1
  11.  
  12. static const unsigned char version[] = "$VER: LED 0.2 "__AMIGADATE__" ©Gérard Cornu ;-)";
  13.  
  14. #include <exec/types.h>
  15. #include <hardware/cia.h>
  16.  
  17. /* Address of CIAA chip: 
  18.  */
  19. #define CIAA 0xBFE001
  20.  
  21. /* Pointer to the CIA (8520) chip: 
  22.  */
  23. struct CIA *cia = (struct CIA *) CIAA;
  24.  
  25. long __saveds led(void) {
  26.    return((cia->ciapra ^= CIAF_LED) & CIAF_LED ? 1: 0);
  27. }
  28.